home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
comm
/
brc_asp1.zip
/
EXECAUTO.ASP
next >
Wrap
Text File
|
1992-01-27
|
14KB
|
353 lines
; Script File: EXECAUTO.ASP
comment ; begin a comment block
Note: This script is written for ProComm Plus version 2. !!!
NOTE: I am using the '^' character to jump to the top menu in a
number of places. ProComm Plus uses '^' as a control character
(for example, '^M' is a carriage return. In order to send a
single '^' I have to code TRANSMIT "^^^". It looks screwy
but it works!
This script can be used in a cold-start mode (let it do the dialing
in an unattended session) -or- it can be called up after a connection
is made (you must be at the main menu). For instance, I sometimes start
a call from my 'get connected and log-on' script to read/send/answer
messages, do file scans or whatever and then invoke this script so
that it can do my accesses, downloads and Turbo message reads.
You should be logged into your download directory.
This script is written for a modem that uses the Hayes/AT command set.
If your modem is different, change the dialing command and response code.
***** Instant commands must be "on" on EXEC-PC. *****
***** Your download protocol on EXEC-PC must be Zmodem. *****
The files 'EXECACCS.?' and 'EXECFILE.?' used in the (A)ccess and
(D)ownload procedures contain filenames and descriptions.
I build them with the LIST program, selecting and writing/appending
lines to them while viewing file lists in logfiles. After the downloads
are finished for each file area, I append the EXECFILE.? file to
another file named 'download.log'.
I run a program at the end of the script that inserts these descriptions
into the downloaded ZIP files and changes the DATE/TIME of the ZIP
files to the date/time of the newest file each contains.
EXECACCS.? and EXECFILE.? (and the file 'download.log') look like this:
JOKIN-31.ZIP 28383 110591 JOKIN AROUND JOKE SERIES #31
EXECSRCH.ZIP 27984 123188+SEARCH EXEC-PC LISTINGS FOR STRINGS - OFFLINE SAVE
XFERNREV.ZIP 7660 020689 UTILITY TO REVERSE ORDER OF EXEC-PC XFER.ARC FILES
The file extension is the letter of the file area. This script uses:
(A) Mahoney/Dos - EXECACCS.A and EXECFILE.A
(B) File list files - EXECACCS.B and EXECFILE.B
(C) Free to all users - EXECACCS.C and EXECFILE.C
(H) Adult files - EXECACCS.H and EXECFILE.H
(I) Picture files - EXECACCS.I and EXECFILE.I
endcomment ; end the comment block
proc main ; Let's get started.
restart: ; we may come back here if we lose our connection
; The two 'when' statements are active for the life of the call.
when 0 "Press any key to continue ->" transmit "^M"
when 1 "More? ([Y]/Stop/Continuous" transmit "~~~~~~C"
if connected ; this statement allows use of this script during a call
goto do_files ; skip the log open/dialing/mail procedures
endif
; Build a name for the log file: EXECmmdd.LOG
assign s0 "exec"
date s2 ; capture the date as mm/dd/yy
substr s1 s2 0 2 ; extract the month
strcat s0 s1 ; append: execMM
substr s1 s2 3 2 ; extract the day
strcat s0 s1 ; append: execMMDD
strcat s0 ".log" ; append: execMMDD.log
log open s0 ; open (create or append) the logfile
;
dialexec:
if not fromddir ; if not called via the dialing directory
clear
time s4 0
date s5
box 0 14 4 65 79
fatsay 2 19 78 "Dialing EXEC-PC at %s on %s" s4 s5
locate 8 0
transmit "ATDT~789-4210^M" ; dial EXEC-PC with commands to the modem
waitfor "connect" 60 ; wait 60 seconds for a connection
if not waitfor ; if modem did not return "connect"
hangup
;;;; pause 9900 ; pause for 2 hours & 45 minutes
pause 3600 ; pause for 1 hour
goto dialexec ; try again
endif
endif
if not connected ; if connection was lost
log close ; close the log file
hangup ; hang up the phone
goto restart ; try again
endif
if not fromddir ; if not originated from the dialing directory
waitfor "What is your FIRST name ->" 90
transmit "firstname^M"
waitfor "What is your LAST name ->" 90
transmit "lastname^M"
waitfor "Password ->" 90
transmit "password;Q^M" ; go directly to the top menu
waitfor "?=HELP) ->" 90 ; Wait for top command
if not connected ; If connection was lost
log close ; close the logfile
hangup ; hang up the phone
goto restart ; Start over again
endif ; (if not connected)
endif ; (if not fromddir)
transmit ";" ; should be at Top Menu
waitfor "Chain->"
transmit "~~B;*^M" ; read bulletins
waitquiet 10 forever ; end of bulletins
transmit "q" ; quit bulletin menu
waitfor "?=HELP) ->" ; Wait for top command
; Read my mail (if any) and leave it marked for later retrieval
transmit ";"
waitfor "Chain->"
transmit "R;N^M"
waitquiet 15 forever ; wait forever for 15 seconds of quiet
; start of file processing **********************************************
; call each procedure using the file area designation
do_files:
call newfiles with "a" ; get new files from Mahoney list (A)
call accesser with "a" ; see if any files to access
call download with "a" ; see if any files to download
call newfiles with "b" ; get new 'file list' files (B)
call accesser with "b" ; see if any files to access
call download with "b" ; see if any files to download
call newfiles with "c" ; get new files from free utility/variety list
call accesser with "c" ; see if any files to access
call download with "c" ; see if any files to download
call newfiles with "h" ; get new files from adult list (H)
call accesser with "h" ; see if any files to access
call download with "h" ; see if any files to download
call newfiles with "i" ; get new files from GIF list (I)
call accesser with "i" ; see if any files to access
call download with "i" ; see if any files to download
transmit "^^^" ; let's make doubly sure
waitfor "?=HELP) ->" 15 ; should be back in Top Menu
if not connected ; If connection was lost
log close ; close the logfile
hangup ; hang up the phone
goto restart ; Start over again
endif
; end of file processing *************************************************
; now we are going to read all of the new messages
; in all of the conferences we have joined
transmit ";"
waitfor "Chain->" 90
transmit "~~m;*;n;f;n;n;t^M" ; read all joined message areas in Turbo mode
waitquiet 30 forever ; wait forever for 30 seconds of quiet
transmit "^^^" ; go to TOP MENU
waitfor "?=HELP) ->" 90
if not connected
goto lost_it
endif
transmit ";"
waitfor "Chain->" 30
transmit "~~g;n^M" ; <G>oodbye, <N>o message
waitfor "click" ; EXEC-PC's disconnection signal
lost_it:
log close ; close the logfile
if connected ; if we're still connected
hangup ; hang up the phone
endif
comment
The following line runs the 'add comment & fix date' program. It uses
the file 'c:\pcplus\asp\download.log' to insert the EXEC-PC file list
description into the comment area of downloaded ZIP files and changes
their date to reflect the latest date of any file within the ZIP.
The 'zipcomdt' program should be accessible through your 'path'.
See the download procedure regarding the download log file.
endcomment
dos "zipcomdt c:\pcplus\asp\download.log" noclear
quit ; exit ProComm Plus, go back to DOS
endproc ; end of the Main procedure
;**********************************************
proc newfiles ; list new files since last call
strparm filearea ; file area to list (A/B/C/D/etc)
string request = "~~f;?;n^M" ; Files/area/New
strupdt request filearea 4 1 ; plug file area in place of ?
transmit ";"
waitfor "Chain->" 90
transmit request ; get new files the file list
waitfor ">>END OF LIST" 300 ; wait for end of list
pause 2
transmit "s" ; stop listing files
waitfor "?=HELP) ->" ; Wait for top command
transmit "^^^" ; go to top menu
waitfor "?=HELP) ->" 15
endproc ; end of 'newfiles' procedure
;**********************************************
proc accesser ; do an 'access' on each file name in a list
strparm filearea ; file area to access
string filename = "c:\pcplus\asp\execaccs." ; name of list file
string request = "~~f;?^M" ; Files/area
strcat filename filearea ; add file area to file name
isfile filename ; does the file exist?
if not success
goto exit_access ; no, skip this procedure
endif
strupdt request filearea 4 1 ; plug file area in place of ?
transmit ";"
waitfor "Chain->" 90
transmit request ; get new files the file list
waitfor "?=HELP) ->" ; Wait for top command
fopen 0 filename "rt" ; open the file as read/text
access_read:
fgets 0 s0 ; read a record
if eof 0 ; was end-of-file encountered?
goto end_acc_file ; yes, exit the procedure
endif
substr s1 s0 0 12 ; pull out the filename (1st 12 bytes)
strcat s1 "^M" ; append a CR
transmit "A" ; (A) is for (A)ccess
waitfor " ->"
transmit s1 ; transmit the filename/CR
when 2 "RETURN to quit) ->" transmit "^M" ; if filename was not found
waitquiet 15 forever ; wait forever for 15 seconds of quiet
cwhen 2 ; clear when/2
goto access_read
end_acc_file:
fclose 0
transmit "Q" ; quit the (A)ccess area
waitfor "?=HELP) ->" 15 ; Wait for top command
if waitfor
delete filename ; delete the access-request file
endif
exit_access:
transmit "^M" ; just in case we're stuck
transmit "^^^" ; go to top menu
waitfor "?=HELP) ->" 90
return ; exit the procedure
endproc ; end of 'accesser' procedure
;**********************************************
proc download ; download a list of files
strparm filearea ; file area to download
string filename = "c:\pcplus\asp\execfile." ; name of the file
string downlog = "c:\pcplus\asp\download.log" ; name of d/l log file
string request = "~~f;?^M" ; Files/area
strcat filename filearea ; add file area to file name
isfile filename ; does the file exist?
if not success
goto exitdlproc ; no, exit the procedure
endif
strupdt request filearea 4 1 ; plug file area in place of ?
transmit ";"
waitfor "Chain->" 90
transmit request ; get new files the file list
waitfor "?=HELP) ->" ; Wait for top command
fopen 0 filename "rt" ; open the file as read/text
transmit "D" ; (D) is for (D)ownload
waitfor "from the BBS ->"
if not waitfor ; if we got lost
goto exitdlproc
endif
dl_read:
fgets 0 s0 ; read a record
if eof 0 ; was end-of-file encountered?
goto end_dl_file ; yes, quit this loop
endif
substr s1 s0 0 12 ; pull out the filename
strcat s1 "^M" ; append a CR
transmit s1 ; transmit the filename/CR
waitfor "from the BBS ->"
goto dl_read
end_dl_file:
fclose 0 ; close the file
transmit "^M" ; no more files to download
waitfor "OK? (YNG) ->" 15
if not waitfor ; if we screwed up
goto exitdlproc ; let's get out of here
endif
transmit "Y" ; Yes, do Zmodem transfer
; At this point, ProComm Plus detects the Zmodem signal and begins reception
waitquiet 60 forever ; Wait for silence (downloads are complete)
; Now we're going to add the list of downloaded files to the download log.
; It's a handy way to remember what files you've downloaded.
fopen 0 filename "rt" ; open the download file as read/text
isfile downlog ; does the logfile already exist?
if success
fopen 1 downlog "at" ; yes, open in append mode
else
fopen 1 downlog "wt" ; no, open in write mode
endif
add_to_log:
fgets 0 s0 ; read a record from EXECFILE.?
if eof 0 ; if end-of-file,
goto end_log_add ; get out
endif
fputs 1 s0 ; write the record to DOWNLOAD.LOG
goto add_to_log
end_log_add: ; finished adding to download.log
fclose 0 ; close EXECFILE.?
fclose 1 ; close DOWNLOAD.LOG
delete filename ; delete EXECFILE.?
exitdlproc:
transmit "^M" ; in case we're stuck
transmit "^^^" ; go to top menu
waitfor "?=HELP) ->" 90
return ; exit the procedure
endproc ; end of 'download' procedure
comment
****************************************************************************
If you find this script useful, please let me know.
If you make improvements to it, definitely let me know. I have tried
to think of everything but that is, of course, impossible.
Even if you try this script and don't like it, I would appreciate
hearing about it. All comments are welcome.
Bruce Clawson - Wauwatosa, WI (USA)
****************************************************************************
endcomment